#pragma once
// -------------------------------------------------
// BlinKit - BlinKit Library
// -------------------------------------------------
//   File Name: runtime_impl.h
// Description: RuntimeImpl Class
//      Author: Ziming Li
//     Created: 2022-03-19
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#ifndef BLINKIT_RUNTIME_IMPL_H
#define BLINKIT_RUNTIME_IMPL_H

#include "bk_js.h"
#include "third_party/quickjs/quickjs.h"

class RuntimeImpl
{
public:
    RuntimeImpl(void *opaque = nullptr);
    ~RuntimeImpl(void);

    JSContext* CreateContext(unsigned features = BK_JS_ALL_FEATURES);
    void RunGC(void) { JS_RunGC(m_runtime); }
private:
    JSRuntime *m_runtime;
};

#endif // BLINKIT_RUNTIME_IMPL_H
